import request from './request'
import mockRequest from './mockRequest'
export const reqCategoryList = ()=>request({url:'/product/getBaseCategoryList',method:'get'})

export const reqGetBannerList =()=>mockRequest({url:'/banner',method:'get'})

export const reqGetFloorList = ()=>mockRequest({url:'/floor',method:'get'})

export const reqSearchList=(data)=>request({url:'/list',method:'post',data})

// /api/item/{ skuId }  get请求
export const reqDetailList = (skuId)=>request({url:`/item/${skuId}`,method:'get'})

// /api/cart/addToCart/{ skuId }/{ skuNum } 添加到购物车请求地址
export const reqaddToCart = (skuId,skuNum)=>request({url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'})

// export const reqAddOrUpdateShopCart = (skuId,skuNum)=>request({url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'});

//获取购物车的数据 /api/cart/cartList
export const reqShopCartList = ()=>request({url:'/cart/cartList',method:'get'})

//删除购物车商品接口 /api/cart/deleteCart/{skuId}  delete请求
export const reqdeleteCart=(skuId)=>request({url:`/cart/deleteCart/${skuId}`,method:'delete'})

//修改某一个产品的选中状态接口/api/cart/checkCart/{skuId}/{isChecked}
export const reqUpdateCartisChecked=(skuId,isChecked)=>request({url:`/cart/checkCart/${skuId}/${isChecked}`,method:'get'})

//获取验证码 /api/user/passport/sendCode/{phone}  get
export const reqCode = (phone) =>request({url:`/user/passport/sendCode/${phone}`,method:'get'})

//注册用户 /api/user/passport/register post
export const reqRegister=(phone,password,code)=>request({url:'/user/passport/register',method:'post',data:{phone,password,code}})

//登录 /api/user/passport/login post 需要发送的参数 phone password
export const reqLogin = (phone,password)=>request({url:'/user/passport/login',method:'post',data:{phone,password}})

//获取用户信息接口  http://182.92.128.115/api/user/passport/auth/getUserInfo
export const reqUserInfo=()=>request({url:'/user/passport/auth/getUserInfo',method:'get'})

// 退出登录接口 /api/user/passport/logout  get
export const reqlogout=()=>request({url:'/user/passport/logout',method:'get'})

//获取用户地址信息 /api/user/userAddress/auth/findUserAddressList
export const reqUserAddress=()=>request({url:'/user/userAddress/auth/findUserAddressList',method:'get'})

//商品清单接口 /api/order/auth/trade
export const reqOrder=()=>request({url:'/order/auth/trade',method:'get'})

//提交订单接口 /order/auth/submitOrder?tradeNo={tradeNo}
export const reqSubmitOrder=(tradeNo,data)=>request({url:`/order/auth/submitOrder?tradeNo=${tradeNo}`,method:'post',data})

//获取支付信息 /api/payment/weixin/createNative/{orderId}  get
export const reqPayInfo =(orderId)=>request({url:`/payment/weixin/createNative/${orderId}`,method:'get'})

//查询订单支付状态 /api/payment/weixin/queryPayStatus/{orderId}
export const reqPayStatus=(orderId)=>request({url:`/payment/weixin/queryPayStatus/${orderId}`,method:'get'})

//获得我的订单列表 /api/order/auth/{page}/{limit}  get 
export const reqMyOrderList =(page,limit)=>request({url:`/order/auth/${page}/${limit}`,method:'get'})